<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:set var="basePath" value="/gyp"></c:set>
<link rel="stylesheet" href="${basePath}/css/index.css">

<jsp:include page="template_header.jsp"></jsp:include>


<div class="home-index">
    <div class="index-gonggao">
        <h1>公告</h1>
        <div class="gonggao-pic"></div>
        <c:forEach items="${gongGaos}" var="g">
            <div class="gonggao-content">
                <p>${g.content}</p>
                <c:if test="${sessionScope.user.username=='admin'}">
                    <a href="${basePath}/gonggao/del/${g.id}">删除</a>
                    <a href="${basePath}/gonggao/update/${g.id}">修改</a>
                </c:if>
            </div>
        </c:forEach>
    </div>
    <div class="index-goods">
        <c:if test="${t1 != null && t1.size() > 0}">
            <div class="index-goods-item">
                <div class="goods-title">
                    <h1>雕刻</h1>
                    <a href="${basePath}/goods/1?type=1">更多</a>
                </div>
                <c:forEach items="${t1}" var="t" varStatus="s">
                    <c:if test="${s.index < 4}">
                        <div class="goods-item-good">
                            <div class="good-pic"><img src="${t.pic}" width="170" height="170"></div>
                            <div class="good-name">${t.name}</div>
                        </div>
                    </c:if>
                </c:forEach>
            </div>
        </c:if>
        <c:if test="${t2 != null && t2.size() > 0}">
            <div class="index-goods-item">
                <div class="goods-title">
                    <h1>瓷器</h1>
                    <a href="${basePath}/goods/1?type=2">更多</a>
                </div>
                <c:forEach items="${t2}" var="t" varStatus="s">
                    <c:if test="${s.index < 4}">
                        <div class="goods-item-good">
                            <div class="good-pic"><img src="${t.pic}" width="170" height="170"></div>
                            <div class="good-name">${t.name}</div>
                        </div>
                    </c:if>
                </c:forEach>
            </div>
        </c:if>
        <c:if test="${t3 != null && t3.size() > 0}">
            <div class="index-goods-item">
                <div class="goods-title">
                    <h1>编制品</h1>
                    <a href="${basePath}/goods/1?type=3">更多</a>
                </div>
                <c:forEach items="${t3}" var="t" varStatus="s">
                    <c:if test="${s.index < 4}">
                        <div class="goods-item-good">
                            <div class="good-pic"><img src="${t.pic}" width="170" height="170"></div>
                            <div class="good-name">${t.name}</div>
                        </div>
                    </c:if>
                </c:forEach>
            </div>
        </c:if>
        <c:if test="${t4 != null && t4.size() > 0}">
            <div class="index-goods-item">
                <div class="goods-title">
                    <h1>其他</h1>
                    <a href="${basePath}/goods/1?type=4">更多</a>
                </div>
                <c:forEach items="${t4}" var="t" varStatus="s">
                    <c:if test="${s.index < 4}">
                        <div class="goods-item-good">
                            <div class="good-pic"><img src="${t.pic}" width="170" height="170"></div>
                            <div class="good-name">${t.name}</div>
                        </div>
                    </c:if>
                </c:forEach>
            </div>
        </c:if>
    </div>
</div>

<jsp:include page="template_footer.jsp"></jsp:include>


